//
//  ActionButton.swift
//  ScanMan
//
//  Created by topnet on 2022/8/16.
//

import UIKit

final class ActionButton: UIButton {

    private lazy var gl = CAGradientLayer()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setTitleColor(.white, for: .normal)
        titleLabel?.font = .font(17)
        
        
        gl.colors = [
            UIColor.hex(0x7EEFB9).cgColor,
            UIColor.hex(0x06B96D).cgColor,
        ]
            
        layer.insertSublayer(gl, at: 0)
        
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        gl.frame = bounds
        gl.cornerRadius = bounds.height/2
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        
        
        
    }
  

}
